package com.ruoyi.omp.api.factory;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.omp.api.RemoteLeaseRecordService;
import com.ruoyi.omp.api.RemoteSuretyService;
import com.ruoyi.omp.api.domain.FeSurety;
import feign.hystrix.FallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component
public class RemoteSuretyFactory implements FallbackFactory<RemoteSuretyService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteSuretyFactory.class);
    @Override
    public RemoteSuretyService create(Throwable throwable) {
        return new RemoteSuretyService() {
            @Override
            public R addSurety(FeSurety feSurety) {
                return R.fail("新增保证金记录失败:" + throwable.getMessage());
            }
        };
    }
}
